/* Layout */
import Layout from '_c/Layout'

import Login from '@/views/login'
/**
 * 静态路由，不需要授权
 */
export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    meta: { title: '用户登录' },
    component: Login,
    hidden: true
  },
  {
    path: '/iframe',
    name: 'iframe',
    component: Layout,
    hidden: true,
    redirect: '/iframe/thirdPage',
    children: [
      {
        path: 'thirdPage',
        component: () => import('@/views/iframe'),
        name: 'thirdPage',
        meta: { title: '外链', noCache: true }
      }
    ]
  },
  {
    path: '/',
    name: 'home',
    component: Layout,
    redirect: 'dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@/views/dashboard/index'),
        name: 'Dashboard',
        meta: { title: '首页', icon: 'dashboard', noCache: true }
      }
    ]
  }
]
/**
 * 动态路由，可配置授权
 */
export const asyncRoutes = [
  {
    path: '/resource',
    component: Layout,
    children: [{
      path: 'manager',
      component: () => import('@/views/resource/manager'),
      name: 'resource-manager',
      meta: { title: '资源管理', noCache: true }
    }]
  },
  {
    path: '/role',
    component: Layout,
    children: [{
      path: 'manager',
      component: () => import('@/views/role/manager'),
      name: 'role-manager',
      meta: { title: '角色管理', noCache: true }
    }]
  },
  {
    path: '/user',
    component: Layout,
    children: [{
      path: 'manager',
      component: () => import('@/views/user/manager'),
      name: 'user-manager',
      meta: { title: '用户管理', noCache: true }
    }, {
      path: 'center',
      component: () => import('@/views/user/center'),
      name: 'user-center',
      meta: { title: '个人中心', noCache: true }
    }]
  },
  {
    path: '/organization',
    component: Layout,
    children: [{
      path: 'manager',
      component: () => import('@/views/organization/manager'),
      name: 'organization-manager',
      meta: { title: '部门管理', noCache: true }
    }]
  },
  {
    path: '/article',
    component: Layout,
    children: [{
      path: 'create',
      component: () => import('@/views/article'),
      name: 'article-add',
      meta: { title: '添加文章', noCache: true }
    }]
  },
  {
    path: '/sys',
    component: Layout,
    children: [{
      path: 'icons',
      component: () => import('@/views/sys/icons'),
      name: 'sys-icons',
      meta: { title: '系统图标' }
    }, {
      path: 'loginLog',
      component: () => import('@/views/sys/loginLog'),
      name: 'login-log',
      meta: { title: '登录日志' }
    }]
  }
]
